﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameStateManagement;
using Microsoft.Xna.Framework;

namespace SharedLib.Network.Client
{
    public class ClientMain
    {
        ScreenManager screenManager;
        Game game;
        GraphicsDeviceManager graphics;

        // By preloading any assets used by UI rendering, we avoid framerate glitches
        // when they suddenly need to be loaded in the middle of a menu transition.
        static readonly string[] preloadAssets =
        {
            "UI/gradient",
        };

        public ClientMain(GraphicsDeviceManager man,Game g)
        {
            game = g;
            graphics = man;

            screenManager = new ScreenManager(g);

            g.Components.Add(screenManager);

            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }

        public void LoadContent()
        {
            foreach (string asset in preloadAssets)
            {
                game.Content.Load<object>(asset);
            }
        }

    }
}
